package com.wise.dubbo.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.wise.dubbo.domain.User;
import com.wise.dubbo.service.CityDubboConsumerService;
import com.wise.dubbo.service.UserService;
import org.springframework.stereotype.Component;

@Component
public class CityDubboConsumerServiceImpl implements CityDubboConsumerService {

    /**
     * 服务调用关键地方：通过@Reference进行服务实现类的bean注入
     */
    @Reference
    UserService userService;

    @Override
    public User saveUser(){
        User user = new User();
        user.setName("lin");
        user.setAddress("amazing");
        return userService.saveUser(user);
    }
}
